//
//  ViewController.m
//  B段项目
//
//  Created by dllo on 15/11/2.
//  Copyright © 2015年 谢美娜. All rights reserved.
//

#import "ViewController.h"
#import "XMN_QuiteViewController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view NightWithType:UIViewColorTypeNormal];
    self.navigationController.navigationBar.translucent = NO;
    [self.navigationController.navigationBar NightWithType:UIViewColorType1];
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil]];
    // Do any additional setup after loading the view, typically from a nib.
    
    //menu按钮
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"menu"] style:UIBarButtonItemStylePlain target:self action:@selector(showLeftViewController)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];
 
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(325 * FitWidth, Height - 50 * FitHeight, 40 * FitWidth, 40 * FitWidth);
    button.layer.masksToBounds = YES;
    button.layer.cornerRadius = 20 * FitWidth;
    button.backgroundColor = [UIColor colorWithRed:0.74 green:0.74 blue:0.74 alpha:.6];
    [button setTitle:@"静" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
}

#pragma mark 点击菜单按钮方法
- (void)showLeftViewController{
    //显示左侧menu菜单
    [(DDMenuController *)[UIApplication sharedApplication].delegate.window.rootViewController showLeftController:YES];
}

-(void)buttonAction{
    XMN_QuiteViewController *quiteVc = [[XMN_QuiteViewController alloc]init];
    quiteVc.modalTransitionStyle = 1;
    [self presentViewController:quiteVc animated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
